/*
 * @Author: 李金深 2896583081@qq.com
 * @Date: 2023-06-08 11:12:54
 * @LastEditors: 李金深 2896583081@qq.com
 * @LastEditTime: 2023-06-30 14:56:12
 * @FilePath: /com.huizhouyiren.web.d0101/src/api/path.js
 * @Description：用户相关接口
 */
import request from './request'

/**
 * @description: 登录
 * @param {*} data
 * @return {*}
 */
export const loginRequest = (data) => {
  return request.post('/account/login', data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description: 注册
 * @param {*} data
 * @return {*}
 */
export const registerRequest = (data) => {
  return request.post('/account/register', data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

/**
 * @description: 获取校验码 |  图片验证码
 * @return {*}
 */
export const getCaptchaRequest = () => {
  return request.get('/account/captcha', {
    params: {}
  })
}

/**
 * @description: 获取用户信息
 * @return {*}
 */
export const getUserInfoRequest = () => {
  return request.get('/member', {
    params: {}
  })
}

/**
 * @description: 获取会员列表
 * @param {*} params
 * @return {*}
 */
export const getMemberListRequest = (params) => {
  return request.get('member/list', {
    params
  })
}

/**
 * @description: 我喜欢的 | 喜欢我的
 * @param {*} params
 * @return {*}
 */
export const getLikeListRequest = (params) => {
  return request.get('member/likelist', {
    params
  })
}

/**
 * @description: 标签 添加|删除
 * @param {*} data
 * @return {*}
 */
export const labelRequest = (data) => {
  return request.post('/member/label', data)
}

/**
 * @description: 用户信息设置
 * @param {*} data
 * @return {*}
 */
export const updateProfileRequest = (data) => {
  return request.post('/member/update', data)
}

/**
 * @description: 更新用户头像
 * @param {*} data
 * @return {*}
 */
export const updateAvatarRequest = (data) => {
  return request.post('/member/setface', data)
}

/**
 * @description: 会员点赞
 * @param {*} data
 * @return {*}
 */
export const memberLikeRequest = (data) => {
  return request.post('/member/like', data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

/**
 * @description: 获取访客
 * @param {*} params
 * @return {*}
 */
export const getVisitorRequest = (params) => {
  return request.get('/member/visit', {
    params
  })
}
/**
 * @description: 添加好友
 * @param {*} data
 * @return {*}
 */
export const addFriendsRequest = (data) => {
  return request.post('/friend/make', data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
/**
 * @description: 同意添加或忽略
 * @param {*} data
 * @return {*}
 */
export const dealFriendsRequest = (data) => {
  return request.post('/friend/agree', data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

/**
 * @description: 修改密码
 * @param {*} data
 * @return {*}
 */
export const updatePasswordRequest = (data) => {
  return request.post('/member/setpwd', data, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
